/*
 * Copyright (c) 2024 OpenValley(ShenZhen) Digital Industry Development Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef UART_RW_OBU_H
#define UART_RW_OBU_H

#define DELAY 5000
// b91_devkit support uart0,uart1, uart0 use to debug
#define UART0 0
#define UART1 1
#define BAUD_115200 115200
#define BAUD_921600 921600

void obu_uart_init(uint32_t port, uint32_t baud);

uint32_t obu_uart_read(char *rxbuf, uint32_t len);

uint32_t obu_uart_write(char *txbuf, uint32_t len);
uint8_t OBU_RXBUF[80] = "\r\nHDF uart read string \r\n";
uint8_t OBU_TXBUF[80] = "\r\nHDF uart write string \r\n";
#endif // UART_RW_OBU_H